package com.wangsd.web.face.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wangsd.web.face.entity.Member;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wangsd.web.face.entity.Merchant;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author generator
 * @since 2019-10-23
 */
public interface MemberService extends IService<Member> {

    IPage<Member> selectList(Integer pageNum, Integer pageSize, Member params, String code);

    void addOrUpdate(Member params);

    /**
     * 验证是否是会员
     * 验证是否推送成为会员链接
     *
     * @param merchandId 商户id
     * @param openId     微信OPENID
     * @param phone      会员电话
     */
    void checkIsToMember(Long merchandId,String openId,String subOpenId,String phone,Integer isSend,Long orderId,String payType);

    Member selectByMerchantIdAndOpenId(Long merchantId, String openId,String subOpenId);

    Member selectByMerchantIdAndMobileAndStatus(Long merchantId, String mobile, Integer i);

    String getValidateCode(String phone);

    /**
     * 通过小程序的openid查询会员信息
     */
    Member selectByMiniOpenId(String miniOpenId);

    /**
     * 注册会员
     */
    void register(Member member);


    Member selectByMerchantIdAndSubOpenIdAndStatus(Long merchantId, String subOpenId, Integer i);
    /**
     * 发送模板消息
     */
    void sendTemplateMsg(String openid,String cardNo,String unionId, Merchant merchant);

    void doMemberAccountChange(Long merchantId, Long orderId, Member member, Integer isSend);
}
